<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="teacher/common :: commonhead">
    <!--<div th:replace="teacher/common :: commonhead"></div>-->
</head>
<head>
    <title>选课请求</title>
    <!--这里写这个页面单独需要的css-->
</head>
<body class="sticky-header">

<section>
    <!--  引入左侧边  -->
    <div th:replace="teacher/common :: left"></div>

    <div class="main-content">
        <div th:replace="teacher/common :: header-section"></div>
        <!--这里开始写东西-->
        <div class="wrapper">
            <div class="row">
                <div class="col-sm-12">
                    <section class="panel">
                        <header class="panel-heading">
                            选课请求列表
                            <span class="tools pull-right">
                                <a href="javascript:;" class="fa fa-chevron-down"></a>
                            </span>
                        </header>
                        <div class="panel-body">
                            <div class="adv-table editable-table ">
                                <div class="space15"></div>
                                <table class="table  table-hover table-bordered" id="editable-sample">
                                    <thead>
                                    <tr>
                                        <th>学号</th>
                                        <th>姓名</th>
                                        <th>专业</th>
                                        <th>同意</th>
                                        <th>拒绝</th>
                                    </tr>
                                    </thead>
                                    <tbody th:each="rq : ${pages.records}">
                                    <tr class="" th:if="${rq.ucState != 2}">
                                        <td th:text="${rq.student.stuId}"></td>
                                        <td th:text="${rq.student.stuName}"></td>
                                        <td th:text="${rq.student.stuMajor}"></td>
                                        <td><a  class="btn btn-success" th:href="@{/teacher/accept(couId=${rq.couId}, teaId=${rq.teaId}, stuId=${rq.stuId})}">同意</a></td>
                                        <td>
                                            <a  class="btn btn-danger" th:href="@{/teacher/refuse(couId=${rq.couId}, teaId=${rq.teaId}, stuId=${rq.stuId})}">拒绝</a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                                <h2 th:if="${pages.pages == 0}">暂无选课请求</h2>
                            </div>

                            <div class="row" th:if="${pages.pages != 0}">
                                <div class="col-lg-6">
                                    <div class="dataTables_info" id="editable-sample_info">
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="dataTables_paginate paging_bootstrap pagination">
                                        <ul>
                                            <li class="prev">
                                                <a th:href="@{/teacher/RequestList(pn=${pages.current - 1 < 1 ? 1 : pages.current - 1})}">← 上一页</a>
                                            </li>
                                            <li th:class="${num == pages.current ? 'active' : ''}" th:each="num : ${#numbers.sequence(1, pages.pages)}">
                                                <a th:href="@{/teacher/RequestList(pn=${num})}" th:text="${num}"></a>
                                            </li>
                                            <li class="next">
                                                <a th:href="@{/teacher/RequestList(pn=${pages.current + 1 > pages.pages ? pages.pages : pages.current + 1})}">下一页 → </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </section>
                </div>
            </div>

        </div>
    </div>
</section>

<div th:replace="teacher/common :: commonjs"></div>

</body>
</html>